﻿using System;
using SimpleServiceBus.Bus.MessageManagement;

namespace SimpleServiceBus.Bus.Pipeline.PipelineComponents.Routing
{
    public class MessageTypeRoute : RouteBase
    {
        private readonly MessageTypePredicate _predicate = new MessageTypePredicate();

        public Type MessageType
        {
            get { return _predicate.MessageType;}
            set { _predicate.MessageType = value; }
        }

        public override bool Matches(MessageEnvelope messageEnvelope)
        {
            return _predicate.Matches(messageEnvelope);
        }
    }
}